package com.example.administrator.hqq.activity;


import android.os.Bundle;
import android.view.View;

import com.bumptech.glide.Glide;
import com.example.administrator.hqq.R;
import com.example.administrator.hqq.activity.drag.DragFrameLayout;
import com.example.administrator.hqq.base.MyActivity;
import com.example.administrator.hqq.config.LoongsConfig;

import butterknife.BindView;
import butterknife.ButterKnife;
import butterknife.OnClick;
import io.rong.photoview.PhotoView;

public class PhotoActivity extends MyActivity {

    @BindView(R.id.photo)
    PhotoView photo;
    @BindView(R.id.auto)
    DragFrameLayout auto;

    @Override
    public void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.activity_photo);
        ButterKnife.bind(this);
        String url = getIntent().getStringExtra(LoongsConfig.url);
        Glide.with(this).load(url).dontAnimate().into(photo);
        photo.setClickable(true);
        photo.setOnClickListener(new View.OnClickListener() {
            @Override
            public void onClick(View view) {
                onBackPressed();
            }
        });
    }
    @OnClick(R.id.auto)
    public void onViewClicked() {
        finish();
    }


    @Override
    protected String getActivityName() {
        return this.getClass().getSimpleName();
    }
}
